#pragma once

#include "ExclusionST2.h"
#include <vector>

class CExclusionDrawer
{
public:
	CExclusionDrawer( 
		const CFont *pFont, 
		const COLORREF colArea, 
		const COLORREF colAreaShade, 
		const CRect &DrawingArea, 
		const CPoint &ImageSize,
		const bool bDrawOffset );
	~CExclusionDrawer(void);

	void drawExclusions( CMemDC *pDC, 
		const nsExclusionStatic2::EExclusionDrawMode DrawMode, 
		const vector<nsExclusionStatic2::SEXCLUSION> &vExclusionAreas, 
		const int iSelected );
	void getAnchors( OUT std::vector<CRect> &vAnchors );

private:
	enum EANCHOR {
		eaTopLeft,
		eaTopMiddle,
		eaTopRight,

		eaMiddleLeft,
		eaMiddleRight,

		eaBottomLeft,
		eaBottomMiddle,
		eaBottomRight,

		eaInside,

		eaMax
	};

	CRect	vAnchors_[ eaMax ];		// Contains SCREEN coordinates !!!

	const CFont *pFont_;
	const COLORREF colArea_,
				   colAreaShade_,
				   colUv_;
	const CRect DrawingArea_,
		DrawingAreaClipped_;
	const bool bDrawOffsetAreas_;
	float	nDivX_,
			nDivY_;

 	void logicalToScreen( CRect *pRect );
	void drawSolidRect( CMemDC *pDC, CRect *pRect, COLORREF col );
	void drawHatchRect( CMemDC *pDC, CRect *pRect, COLORREF colForeground, COLORREF colBackground );
	void drawAnchors( CMemDC *pDC, CRect *pRect );
	void drawCounter( int iCount, CMemDC *pDC, CRect *pRect );
	void drawFrame( CMemDC *pDC, CRect *pRect, CBrush *pBrush );
	void drawExclusionFrameSelected( CMemDC *pDC, CRect *pRect );

	void drawAnchor( EANCHOR Anchor, CMemDC *pDC, int x, int y );

};
